package com.huaxin.hxcloud.Adapter;

import android.support.annotation.Nullable;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.huaxin.common.Entity.StationTaskDetail;
import com.huaxin.hxcloud.R;

import java.util.List;

/**
 * @author lwjing
 * @date 2018/3/21
 * @Desc $desc$
 * Copyright HUAXIN DATA. All rights reserved.
 */
public class HorizontalStationAdapter extends BaseQuickAdapter<StationTaskDetail, BaseViewHolder> {

    public HorizontalStationAdapter(int layoutResId, @Nullable List<StationTaskDetail> data) {
        super(R.layout.item_string, data);
    }

    @Override
    protected void convert(BaseViewHolder baseViewHolder, StationTaskDetail workTask) {
        TextView tv_station_name = baseViewHolder.getView(R.id.tv_item_string);
        tv_station_name.setText(workTask.getName());
        if (workTask.isCheck()){
            tv_station_name.setSelected(true);
            tv_station_name.setTextColor(mContext.getResources().getColor(R.color.white));
        }else{
            tv_station_name.setSelected(false);
            tv_station_name.setTextColor(mContext.getResources().getColor(R.color.text_color_2));
        }
    }
}
